import axios from 'axios'
import { baseURL } from '../configFile'
import { Store } from 'antd/lib/form/interface'

const axiosReq = axios.create({
    baseURL
})

//登陆页面用到的请求
export const loginReq = (data: Store) => {
    return axiosReq.post('/userlogin', data)
}

//持久化登录状态的请求
export const checkSessionReq = () => {
    return axiosReq.get('/checkSessionExist')
}

//登出请求
export const logoutReq = () => {
    return axiosReq.get('/logout')
}

//获取验证码
export const getCode = () => {
    return axiosReq.get('/captcha');
}